#include "Player.h"
#include "AnimationSystem.h"
#include "TileSystem.h"
#include "stdafx.h"
#include "Portal.h"
#include "Dash.h"
#include "BackDash.h"
#include "AugmentTable.h"
#include "Pickup.h"
#include "Frame.h"

#define JUMPVELOCITY -845.5f

#define GAMEPAD_A 0
#define GAMEPAD_B 1
#define GAMEPAD_X 2
#define GAMEPAD_Y 3
#define GAMEPAD_LB 4
#define GAMEPAD_PAUSE 7

#define DASHCOOLDOWN 3.0f

#define TERMINAL_VELOCITY 540

Player::Player()
{
	EnterWalking();

	pInput = SGD::InputManager::GetInstance();
	theGame = Game::GetInstance();
	gameplay = GameplayState::GetInstance();
	TS = TileSystem::GetInstance();

	//register the player for all necessary events
	RegisterForEvent("GAMEOVER");
	RegisterForEvent("DEATH");

	//load in all the player's sounds
	m_AAugSwap = SGD::AudioManager::GetInstance()->LoadAudio("resource/Sounds/thunk.wav");
	gettingHitSFX = SGD::AudioManager::GetInstance()->LoadAudio("resource/Sounds/GruntSoundEffect.wav");
	deathSound = SGD::AudioManager::GetInstance()->LoadAudio("resource/Sounds/deathSound.wav");
	slideSFX = SGD::AudioManager::GetInstance()->LoadAudio("resource/Sounds/slidingSFX.wav");
	dashingSFX = SGD::AudioManager::GetInstance()->LoadAudio("resource/Sounds/dashingSFX.wav");
	jumpingSFX = SGD::AudioManager::GetInstance()->LoadAudio("resource/Sounds/jumpingSFX.wav");


	//set hotswap[0] to nullptr
	HotSwap[0] = nullptr;
	HotSwap[1] = nullptr;
	HotSwap[2] = nullptr;
	HotSwap[3] = nullptr;

	//set the player's max health
	m_iMaxHealth = 500;
	m_iHealth = m_iMaxHealth;

	armImage = SGD::GraphicsManager::GetInstance()->LoadTexture("resource/Graphics/shooting_arm.png");

	getPickUp = pAudio->LoadAudio("resource/Sounds/healthPickUp.wav");
}

Player::~Player()
{
	//unload all the player's audio
	SGD::AudioManager::GetInstance()->UnloadAudio(m_AAugSwap);
	SGD::AudioManager::GetInstance()->UnloadAudio(gettingHitSFX);
	SGD::AudioManager::GetInstance()->UnloadAudio(deathSound);
	SGD::AudioManager::GetInstance()->UnloadAudio(jumpingSFX);
	SGD::AudioManager::GetInstance()->UnloadAudio(dashingSFX);
	SGD::AudioManager::GetInstance()->UnloadAudio(slideSFX);
	pAudio->UnloadAudio(getPickUp);

	SGD::GraphicsManager::GetInstance()->UnloadTexture(armImage);

	//unload all images from the animation system
	//AnimationSystem::GetInstance()->UnloadTexture();
}

void Player::Update(float elapsedTime)
{
	if (m_vtVelocity.y > TERMINAL_VELOCITY)
		m_vtVelocity.y = TERMINAL_VELOCITY;


	dt = elapsedTime;
	m_fAttackRate -= elapsedTime;

	if (m_iShieldCount > 0)
		shielded = true;
	else
		shielded = false;

	if (m_fAttackRate <= 0)
		m_fAttackRate = 0;

	bool leftFoot = TS->CheckCollison(gameplay->GetMapIndex(), { GetRect().left, GetPosition().y + 5 });
	bool rightFoot = TS->CheckCollison(gameplay->GetMapIndex(), { GetRect().right, GetPosition().y + 5 });

	if (leftFoot && rightFoot)
		collidedWithEnemy = false;

	if (m_bUsingBulletTable || m_bUsingShotTable)
	{
		int Augtablesize = AugmentWeaponTable.size();
		if (unsigned int(m_nCursor) >= AugmentWeaponTable.size())
			m_nCursor = 0;
		if (m_nCursor < 0)
			m_nCursor = AugmentWeaponTable.size() - 1;
	}
	if (m_bUsingMoveTable)
	{
		int Augtablesize = AugmentMoveTable.size();
		if (m_nCursor >= Augtablesize)
			m_nCursor = 0;
		if (m_nCursor < 0)
			m_nCursor = AugmentMoveTable.size() - 1;
	}

	pastPosition = m_ptPosition;
	Frame pastFrame;
	if (animInfo.GetCurrAnimation() != "")
		pastFrame = AnimationSystem::GetInstance()->GetLoaded()[animInfo.GetCurrAnimation()].GetFrames()[animInfo.GetCurrFrame()];
	pastAnchorPoint = pastFrame.GetAnchorPoint();
	pastCollisionRect = pastFrame.GetCollisionRect();

	//State switching
	if (m_iHealth <= 0)
		EnterDead();
	else if (gravityOn)
		EnterJumping();
	else if (dashing || sliding)
	{

	}
	else if (state == State::CLIMBING)
	{
		if (!onLadder)
		{
			EnterIdle();
			m_vtVelocity.y = 0;
		}
	}
	else if (state == State::STAIRS)
	{
		if (!onStairs)
		{
			EnterIdle();
			m_vtVelocity.y = 0;
		}
		else if (onStairs && m_vtVelocity.x && animInfo.GetCurrAnimation() != "playerwalking")
		{
			SetCurrAnimation("playerwalking");
			AnimationSystem::GetInstance()->StartPlaying(animInfo);
			AnimationSystem::GetInstance()->StartLooping(animInfo);
		}
		else if (onStairs && !m_vtVelocity.x)
		{
			SetCurrAnimation("playeridle");
			AnimationSystem::GetInstance()->StartPlaying(animInfo);
			AnimationSystem::GetInstance()->StartLooping(animInfo);
		}
	}
	else if (lastPos.x != GetPosition().x)
		EnterWalking();
	else
		EnterIdle();

	lastPos = GetPosition();

	//Update animations depending on state
	switch (state)
	{
	default://(IDLE)
	{
		if (!leftFoot && !rightFoot)
			gravityOn = true;
	}
		break;
	case Player::WALKING:
	{
		if (!leftFoot && !rightFoot)
			gravityOn = true;
	}
		break;
	case Player::JUMPING:
		m_vtVelocity.y += gravity.y*elapsedTime;
		break;
	case Player::CLIMBING:
		break;
	case Player::STAIRS:
		break;
	}



	levelPortal = false;
	uccPortal = false;
	warpPortal = false;
	onLadder = false;
	onStairs = false;
	//if gravity is on then start pulling the player down
	if (gravityOn)
		m_vtVelocity += (gravity)* elapsedTime;

	if (m_vtVelocity.y >= 0 && !gravityOn)
	{
		if (m_aMoveSlot != nullptr && m_aMoveSlot->GetAugName() == "Double Jump")
			((DoubleJump*)m_aMoveSlot)->SetDJump(false);
		m_bIsJumping = false;
	}

	//a small chunk of code that locks the player inside the world.
	if (m_ptPosition.x < minPosInWorld)
	{
		m_ptPosition.x = minPosInWorld + (GetRect().ComputeWidth() * .5f);
	}

	//Update all the necessary timers
	UpdateTimers(elapsedTime);

	//Call moving object's update
	MovingObject::Update(elapsedTime);

	if (m_bTouchingWepTable == false && m_bTouchingMoveTable == false)
	{
		m_bUsingBulletTable = false;
		m_bUsingShotTable = false;
		m_bUsingMoveTable = false;


	}
	m_bTouchingWepTable = false;
	m_bTouchingMoveTable = false;
	m_bTouchingMoveAugment = false;
	m_bTouchingWeaponAugment = false;
	if (!m_bUsingBulletTable && !m_bUsingMoveTable && !m_bUsingShotTable)
		m_nCursor = 0;
}

void Player::Input(void)
{
	if (state == State::DEAD) return;

	SGD::InputManager * pInput = SGD::InputManager::GetInstance();

	//~400 lines of code in one nice simple little function
	AugmentTableFunctionality();

	//if (pInput->IsKeyDown(SGD::Key::Backspace))
	//{
	//	//Set the position to the center of the initial screen that is displayed
	//	SetPosition({ 400, 300 });
	//}

	////deal 100 damage to the player
	//if (pInput->IsKeyPressed(SGD::Key::F1))
	//{
	//	SGD::AudioManager::GetInstance()->PlayAudio(gettingHitSFX);
	//	damageFlash = true;
	//	m_iHealth -= 100;
	//}
	//#endif

	//Set the aiming vector to (0,0)
	aiming = SGD::Vector(0, 0);

	//get where the left stick is currently pointed
	SGD::Vector tempvec = pInput->GetLeftJoystick(0);

	//if (pInput->IsKeyDown(SGD::Key::D) || tempvec.x >= 0.9f)
	//{
	//m_vtVelocity = { 500, m_vtVelocity.y };
	//
	//SGD::Vector tempvec = pInput->GetLeftJoystick(0);
	if (!m_bUsingBulletTable && !m_bUsingMoveTable && !m_bUsingShotTable) // Dont allow other player input while accessing Augment Tables
	{
		if (!usingAbility)
		{
			//Move character
			if (theGame->RightInput(tempvec)) UseRight();
			else if (theGame->LeftInput(tempvec)) UseLeft();
			else if (theGame->DownInput(tempvec)) UseDown();
			else if (!dashing && !collidedWithEnemy)
			{
				m_vtVelocity = { 0.0f, m_vtVelocity.y };
				aiming.x = 0;
			}

			//Up
			if (theGame->UpInput(tempvec))
				UseInteract();

			//Climbing
			if (state == State::CLIMBING && (!theGame->UpInput(tempvec) && !theGame->DownInput(tempvec)))
				m_vtVelocity = { 0.0f, 0.0f };

			//Stairs
			if (state == State::STAIRS && (!theGame->RightInput(tempvec) && !theGame->LeftInput(tempvec)))
				m_vtVelocity = { 0.0f, 0.0f };

			//Jumping
			if (theGame->JumpInput() && !m_bTouchingMoveAugment && !m_bTouchingWeaponAugment)
				UseJump();

			if (theGame->DownInput(tempvec))
			{
				//Set the direction the player is aiming to down
				aiming.y = 1;
			}

			//if the joystick is being pressed in any direction
			if (tempvec.x >= 0.8f || tempvec.x <= -0.8f || tempvec.y <= -0.8f || tempvec.y >= 0.8f)
			{
				//set the direction the player is aiming to the position of the left joystick
				aiming = tempvec;
			}



			//if the player is not aiming any direction
			if (aiming == SGD::Vector(0, 0))
			{
				//set the direction the playwer is aiming to the direction he is currently facing
				aiming.x = float(GetFacing());
			}

			//fire in the direction that the player is aiming
			if (theGame->FireInput() && m_fAttackRate <= 0 && !m_bTouchingWeaponAugment)
			{
				SetAppropiateFireRate();
				Shoot();
			}

			//use whatever movement ability the player has equipped
			if (theGame->MovementAbilityInput() && !m_bTouchingMoveAugment && !m_bTouchingWeaponAugment) UseMovement();

			

			HotSwapFunctionality();

			if (theGame->HoldPositionInput() && gravityOn == false) //Hold position
			{
				m_vtVelocity = { 0, m_vtVelocity.y };
			}
			//I think this is incomplete:
			//if (theGame->UpInputPressed(tempvec))
			//EnterClimbing();
		}

		//Just fr testiing
		//if (pInput->IsKeyPressed(SGD::Key::Up))
		//EnterClimbing();
	}
}

void Player::UseLeft()
{
	if (state == State::DEAD || state == State::CLIMBING || m_fStunTimer > 0.0f) return;
	else if (state == State::STAIRS)
	{
		m_vtVelocity = { -100, 100 };
	}
	else
		m_vtVelocity = { -250, m_vtVelocity.y };

	//Set the direction the player is facing and aiming to the left
	SetFacing(-1);
	aiming.x = -1;
}

void Player::UseRight()
{
	if (state == State::DEAD || state == State::CLIMBING || m_fStunTimer > 0.0f) return;
	else if (state == State::STAIRS)
	{
		m_vtVelocity = { 100, -100 };
	}
	else
		m_vtVelocity = { 250, m_vtVelocity.y };

	//Set the direction the player is facing and aiming to the right
	SetFacing(1);
	aiming.x = 1;
}

void Player::UseDown()
{
	if (m_fStunTimer > 0.0f) return;

	bool leftFoot = TS->CheckCollison(gameplay->GetMapIndex(), { GetRect().left, GetPosition().y + 5 });
	bool rightFoot = TS->CheckCollison(gameplay->GetMapIndex(), { GetRect().right, GetPosition().y + 5 });

	if (state == State::CLIMBING)
	{
		m_vtVelocity = { 0.0f, 100.0f };
		if (leftFoot && rightFoot)
			EnterIdle();
	}
	else if (onLadder && state != State::CLIMBING)
	{
		EnterClimbing();
	}
	else if (onStairs && state != State::STAIRS)
	{
		EnterStairs();
		m_vtVelocity = { 0, 0 };
		gravityOn = false;
	}
	else
	{
		m_vtVelocity.x = 0.0f;
	}
}

void Player::UseInteract()
{
	if (levelPortal && nextLevel >= level)
	{
		GameplayState::GetInstance()->SetLevel(level);
		theGame->PlaySFX(theGame->PORTAL);
	}
	else if (uccPortal)
	{
		GameplayState::GetInstance()->SetDisplayUCC(true);
	}
	else if (warpPortal)
	{
		m_ptPosition = warpLoc;
		theGame->PlaySFX(theGame->PORTAL);
	}
	else if (onLadder && state == State::CLIMBING)
	{
		//Go up
		m_vtVelocity = { 0.0f, -100.0f };
	}
	else if (onLadder && state != State::CLIMBING)
	{
		EnterClimbing();
		m_vtVelocity = { 0, 0 };
		gravityOn = false;
	}
	else if (onStairs && state != State::STAIRS)
	{
		m_ptPosition.y -= int(m_ptPosition.x) % 32;
		EnterStairs();
		m_vtVelocity = { 0, 0 };
		gravityOn = false;
	}
	else
	{
		//Set the direction the player is aiming to up
		aiming.y = -1;
	}
}

void Player::UseJump()
{
	if (state == State::DEAD || m_fStunTimer > 0.0f) return;
	//if (state == State::CLIMBING || state == State::STAIRS)
	//{
	//	EnterJumping();
	//	gravityOn = true;
	//}

	if (!m_bIsJumping && (state == State::IDLE || state == State::WALKING || state == State::STAIRS || state == State::CLIMBING))
	{
		m_vtVelocity = { m_vtVelocity.x, JUMPVELOCITY };
		m_bIsJumping = true;
		gravityOn = true;
	}
	else if (m_bIsJumping && m_aMoveSlot && m_aMoveSlot->GetAugName() == "Double Jump")
	{
		DoubleJump * temp = (DoubleJump*)m_aMoveSlot;
		if (temp->GetDJump() == false)
		{
			//m_vtVelocity.y += -60;
			m_vtVelocity.y = JUMPVELOCITY;
			temp->SetDJump(true);
			gravityOn = true;
		}
	}
}

void Player::UseMovement()
{
	if (state == State::CLIMBING || state == State::STAIRS || state == State::DEAD || state == State::MOVEMENT) return;

	if (GetMoveSlot())
	{
		switch (GetMoveSlot()->GetType())
		{
		case Movement::MOVE_DASH:
			StartDashing();
			break;
		case Movement::MOVE_BACKDASH:
			StartBackDashing();
			break;
		case Movement::MOVE_SLIDE:
			StartSliding();
			break;
		default:
			break;
		}
	}
}

void Player::Render(void)
{

	SGD::Point position;
	position.x = this->GetPosition().x - Game::GetInstance()->GetCameraPos().x;
	position.y = this->GetPosition().y - Game::GetInstance()->GetCameraPos().y;
	SGD::GraphicsManager * pGraphics = SGD::GraphicsManager::GetInstance();
	BitmapFont* pFont = Game::GetInstance()->GetFont();

	if (m_fDotTimer > 0)
	{
		myEmitter->Render();
	}

	if (m_fSlowTimer > 0)
	{
		myEmitter->Render();

	}

	if (m_fStunTimer > 0)
	{
		myEmitter->Render();
	}


	if (m_bTouchingMoveAugment)
	{
		pGraphics->DrawRectangle({ position.x, position.y + 2, position.x + 240, position.y + 60 }, { 100, 50, 50, 50 }, { 0, 0, 0 }, 3);
		if (SGD::InputManager::GetInstance()->IsControllerConnected(0))
			pGraphics->DrawString("  X to equip to MoveSlot\n B to send to Base", { position.x + 2, position.y + 5 }, { 255, 0, 0 });
		else
		pGraphics->DrawString(" J to equip to MoveSlot\n L to send to Base", { position.x + 2, position.y + 5 }, { 255, 0, 0 });

	}
	if (m_bTouchingWeaponAugment)
	{
		pGraphics->DrawRectangle({ position.x, position.y + 2, position.x + 200, position.y + 80 }, { 100, 50, 50, 50 }, { 0, 0, 0 }, 3);
		if (SGD::InputManager::GetInstance()->IsControllerConnected(0))
			pGraphics->DrawString(" X to equip to Style\n A to equip Bullet\n B to send to base", { position.x + 2, position.y + 5 }, { 255, 0, 0 });
		else
		pGraphics->DrawString(" J to equip to Style\n K to equip Bullet\n L to send to base", { position.x + 2, position.y + 5 }, { 255, 0, 0 });
	}


	AugmentTableInterface();
	AnimationSystem::GetInstance()->Render(position, animInfo);
	if (animInfo.GetCurrAnimation() != "")
	{
		if (facing > 0)
		{
			float angle = SGD::Vector((float)facing, 0).ComputeAngle(aiming);
			SGD::Point weaponOffset = GetWeaponOffset();
			if (aiming.y <= 0)
				pGraphics->DrawTexture(armImage, { weaponOffset.x - 15 - theGame->GetCameraPos().x, weaponOffset.y - 20 - theGame->GetCameraPos().y }, -angle, { 11, 18 });
			else if (aiming.y > 0)
				pGraphics->DrawTexture(armImage, { weaponOffset.x - 15 - theGame->GetCameraPos().x, weaponOffset.y - 20 - theGame->GetCameraPos().y }, angle, { 11, 18 });
		}
		else if (facing < 0)
		{
			float angle = SGD::Vector((float)facing, 0).ComputeAngle(aiming);
			SGD::Point weaponOffset = GetWeaponOffset();
			if (aiming.y <= 0)
				pGraphics->DrawTexture(armImage, { weaponOffset.x + 17 - theGame->GetCameraPos().x, weaponOffset.y - 20 - theGame->GetCameraPos().y }, angle, { 11, 18 }, {}, { -1.0f, 1.0f });
			else if (aiming.y > 0)
				pGraphics->DrawTexture(armImage, { weaponOffset.x + 17 - theGame->GetCameraPos().x, weaponOffset.y - 20 - theGame->GetCameraPos().y }, -angle, { 11, 18 }, {}, { -1.0f, 1.0f });
		}
	}
	//render a blue circle around the player if he has a shield
	if (m_iShieldCount > 0 && facing < 0) // center shield when facing left
		SGD::GraphicsManager::GetInstance()->DrawTexture(gameplay->shield, { position.x - 28, position.y - 56 });
	else if (m_iShieldCount > 0 && facing > 0) // center shield when facing right
		SGD::GraphicsManager::GetInstance()->DrawTexture(gameplay->shield, { position.x - 32, position.y - 56 });

#ifdef _DEBUG
	//SGD::GraphicsManager::GetInstance()->DrawString(itoa(state, new char[100], 10), {10.0f, 50.0f});
#endif
}

void Player::EnterIdle()
{
	if (state == State::IDLE) return;

	SetCurrAnimation("playeridle");
	AnimationSystem::GetInstance()->StartPlaying(animInfo);
	AnimationSystem::GetInstance()->StartLooping(animInfo);
	state = State::IDLE;
}

void Player::EnterWalking()
{
	if (state == State::WALKING) return;

	SetCurrAnimation("playerwalking");
	AnimationSystem::GetInstance()->StartPlaying(animInfo);
	AnimationSystem::GetInstance()->StartLooping(animInfo);
	state = State::WALKING;
}

void Player::EnterJumping()
{
	if (state == State::JUMPING) return;

	pAudio->PlayAudio(jumpingSFX);
	SetCurrAnimation("playerjumping");
	AnimationSystem::GetInstance()->StartPlaying(animInfo);
	AnimationSystem::GetInstance()->StartLooping(animInfo);
	state = State::JUMPING;
}

void Player::EnterClimbing()
{
	if (state == State::CLIMBING) return;

	SetCurrAnimation("playerjumping");
	AnimationSystem::GetInstance()->StartPlaying(animInfo);
	AnimationSystem::GetInstance()->StartLooping(animInfo);
	state = State::CLIMBING;
}

void Player::EnterStairs()
{
	if (state == State::STAIRS) return;

	SetCurrAnimation("playerwalking");
	AnimationSystem::GetInstance()->StartPlaying(animInfo);
	AnimationSystem::GetInstance()->StartLooping(animInfo);
	state = State::STAIRS;
}

void Player::EnterDead()
{
	if (state == State::DEAD) return;

	minPosInWorld = 0;
	SetCurrAnimation("playerdeath");
	AnimationSystem::GetInstance()->StartPlaying(animInfo);
	AnimationSystem::GetInstance()->StartLooping(animInfo);
	state = State::DEAD;
}

void Player::HandleEvent(const SGD::Event* pEvent)
{
	MovingObject::HandleEvent(pEvent);
	if (pEvent->GetEventID() == "GAMEOVER")
	{
		isAlive = false;
	}
	if (pEvent->GetEventID() == "DEATH")
	{
		pAudio->PlayAudio(deathSound);
		//TODO get rid of all debuffs on the player
		m_fStunTimer = 0.0f;
		m_fDotTimer = 0.0f;
		m_fDotDmgTimer = 0.0f;
		m_fSlowTimer = 0.0f;
	}
}

void Player::HandleCollision(GameObject* pOther)
{
	BitmapFont* pFont = Game::GetInstance()->GetFont();
	Projectile* tempObject = dynamic_cast<Projectile*>(pOther);

	// is pOther a bullet object
	if (pOther->GetType() == OBJ_BULLET && tempObject && tempObject->GetOwner() != this)
	{
		if (!damageFlash)
			SGD::AudioManager::GetInstance()->PlayAudio(gettingHitSFX);
		// call MovingObjects HandleCollision
		MovingObject::HandleCollision(pOther);

	}
	else if (pOther->GetType() == PortalType::PORTAL_LOADLEVEL)
	{
		levelPortal = true;
		level = dynamic_cast<const Portal*>(pOther)->GetLevel();
	}
	else if (pOther->GetType() == PortalType::PORTAL_PLAYERLEVEL)
	{
		uccPortal = true;
	}
	else if (pOther->GetType() == PortalType::PORTAL_HIDDENAREA)
	{
		warpPortal = true;
		warpLoc = dynamic_cast<const Portal*>(pOther)->GetWarpLoc();
	}
	else if (pOther->GetType() == Pickup::PICK_HP)
	{
		m_iHealth += dynamic_cast<Health*>(pOther)->GetHealAmount();
		if (m_iHealth > m_iMaxHealth)
			m_iHealth = m_iMaxHealth;
		pAudio->PlayAudio(getPickUp);
	}
	else if (pOther->GetType() == Pickup::PICK_SHIELD)
	{
		m_iShieldCount++;
		pAudio->PlayAudio(getPickUp);
	}

	if (pOther->GetType() == StaticObject::STAT_LADDER)
	{
		onLadder = true;
	}

	if (pOther->GetType() == StaticObject::STAT_STAIRS)
	{
		onStairs = true;
	}

	if (pOther->GetType() == StaticObject::STAT_TABLE) // HANDLE TABLE INTERACTION
	{
		AugmentTable* temp = (AugmentTable*)(pOther);
		if (temp->GetTabletype() == 0 || temp->GetTabletype() == 1)
			m_bTouchingWepTable = true;
		else
			m_bTouchingMoveTable = true;
		if (theGame->ExitTableInput())
		{
			if (temp->GetTabletype() == 0 && AugmentWeaponTable.size() > 0)
				m_bUsingBulletTable = !m_bUsingBulletTable;
			if (temp->GetTabletype() == 1 && AugmentWeaponTable.size() > 0)
				m_bUsingShotTable = !m_bUsingShotTable;
			if (temp->GetTabletype() == 2 && AugmentMoveTable.size() > 0)
				m_bUsingMoveTable = !m_bUsingMoveTable;

			if ((m_bUsingBulletTable || m_bUsingShotTable) && AugmentWeaponTable.size() == 0)
			{
				m_bUsingBulletTable = false;
				m_bUsingShotTable = false;
			}
			if (m_bUsingMoveTable && AugmentMoveTable.size() == 0)
			{
				m_bUsingMoveTable = false;
			}
		}
	}

	if (pOther->GetType() >= 60 && pOther->GetType() < 82) // Augment GEtTYPE Range
	{
		SGD::GraphicsManager * pGraphics = SGD::GraphicsManager::GetInstance();
		SGD::Point position;
		position.x = this->GetPosition().x - Game::GetInstance()->GetCameraPos().x;
		position.y = this->GetPosition().y - Game::GetInstance()->GetCameraPos().y;
		if (pOther->GetType() >= 60 && pOther->GetType() < 65)
			m_bTouchingMoveAugment = true;
		else
			m_bTouchingWeaponAugment = true;

		if (theGame->FireInput()) // Equip into Shotstyle or MoveStyle
		{
			TakeAugment(pOther, 0);
			SGD::AudioManager::GetInstance()->PlayAudio(dynamic_cast<Augment*>(pOther)->GetAugPickUpAudio());

		}
		if (theGame->JumpInput() && pOther->GetType() >= 70 && pOther->GetType() < 82) // Equip into BulletShot
		{
			TakeAugment(pOther, 1);
			SGD::AudioManager::GetInstance()->PlayAudio(dynamic_cast<Augment*>(pOther)->GetAugPickUpAudio());
		}
		if (theGame->MovementAbilityInput()) // Send to Base!
		{
			TakeAugment(pOther, 2);
			SGD::AudioManager::GetInstance()->PlayAudio(dynamic_cast<Augment*>(pOther)->GetAugPickUpAudio());
		}

	}

	// if player colliding with enemy
	if (pOther->GetType() == OBJ_ENEMY)
	{
		if (!shielded && !damageFlash && Shieldtimer <= 0)
		{
			Enemy* tempEnemy = dynamic_cast<Enemy*>(pOther);


			m_iHealth -= tempEnemy->GetDamage();
			m_iComboMultipiler = 1;
			m_iCurrComboCount = 1;
			m_fComboTimer = 0.0f;
			//m_iHealth -= dynamic_cast<const Enemy*>(pOther)->GetDamage();
			damageFlash = true;
			SGD::AudioManager::GetInstance()->PlayAudio(gettingHitSFX);

			if (GetActiveRect().IsIntersecting(pOther->GetActiveRect()))
			{
				m_iHealth -= dynamic_cast<const Enemy*>(pOther)->GetDamage() * 2;
			}
		}
		else if (shielded)
		{
			m_iShieldCount--;
			Shieldtimer = 1.0f;
			if (m_iShieldCount <= 0)
			{
				shielded = false;
				m_iShieldCount = 0;
			}
		}

		// CHARACTER COLLISION
		// create rect for pastPosition
		if (animInfo.GetCurrAnimation() != "" && AnimationSystem::GetInstance()->Contains(animInfo.GetCurrAnimation()))
		{
			//shortcuts
			SGD::Rectangle colRect = pastCollisionRect;

			//Return the current collision rectangle
			pastRect = { SGD::Point(pastPosition.x - pastAnchorPoint.x + colRect.left, pastPosition.y - pastAnchorPoint.y + colRect.top),
				SGD::Size(colRect.ComputeWidth(), colRect.ComputeHeight()) };
		}

		// create rect for pOther->Location
		SGD::Rectangle otherRect;
		if (animInfo.GetCurrAnimation() != "" && AnimationSystem::GetInstance()->Contains(animInfo.GetCurrAnimation()))
		{
			//shortcuts
			Frame currFrame = AnimationSystem::GetInstance()->GetLoaded()[animInfo.GetCurrAnimation()].GetFrames()[animInfo.GetCurrFrame()];
			SGD::Rectangle colRect = currFrame.GetCollisionRect();
			SGD::Point pt = currFrame.GetAnchorPoint();

			//Return the current collision rectangle
			otherRect = { SGD::Point(pOther->GetPosition().x - pt.x + colRect.left, pOther->GetPosition().y - pt.y + colRect.top),
				SGD::Size(colRect.ComputeWidth(), colRect.ComputeHeight()) };
		}

		// check CharacterCollision, if true fix position
		if (gameplay->CheckCharacterCollision(pastRect, GetRect(), otherRect))
		{
			Enemy* enemy = dynamic_cast<Enemy*>(pOther);

			// reset position based on side of collision
			if (gameplay->left || gameplay->right || gameplay->top || gameplay->bottom)
			{
				collidedWithEnemy = true;

				m_vtVelocity = -m_vtVelocity;
				m_ptPosition = pastPosition + m_vtVelocity * dt;
			}
		}
	}
}

void Player::StartDashing()
{
	if (dashCooldown <= 0.0f)
	{
		pAudio->PlayAudio(dashingSFX);
		usingAbility = true;
		dashing = true;
		dashTimer = dynamic_cast<Dash*>(GetMoveSlot())->GetDuration();
		dashCooldown = dynamic_cast<Dash*>(GetMoveSlot())->GetCooldown();
		m_vtVelocity = { dynamic_cast<Dash*>(GetMoveSlot())->GetSpeedIncrease() * (float)facing, m_vtVelocity.y };
		SetCurrAnimation("playerdash");
		AnimationSystem::GetInstance()->StartPlaying(animInfo);
		AnimationSystem::GetInstance()->StartLooping(animInfo);
	}
}

void Player::StartBackDashing()
{
	if (backDashCoolDown <= 0.0f)
	{
		pAudio->PlayAudio(dashingSFX);
		usingAbility = true;
		backDashing = true;
		backDashTimer = dynamic_cast<BackDash*>(GetMoveSlot())->GetDuration();
		backDashCoolDown = dynamic_cast<BackDash*>(GetMoveSlot())->GetCooldown();
		m_vtVelocity = { dynamic_cast<BackDash*>(GetMoveSlot())->GetSpeedIncrease() * (float)facing, m_vtVelocity.y };
		SetCurrAnimation("playerbackdash");
		AnimationSystem::GetInstance()->StartPlaying(animInfo);
		AnimationSystem::GetInstance()->StartLooping(animInfo);
	}
}

void Player::StartSliding()
{
	if (slideCoolDown <= 0.0f)
	{
		pAudio->PlayAudio(slideSFX);
		usingAbility = true;
		sliding = true;
		slideTimer = dynamic_cast<Slide*>(GetMoveSlot())->GetDuration();
		slideCoolDown = dynamic_cast<Slide*>(GetMoveSlot())->GetCooldown();
		m_vtVelocity = { dynamic_cast<Slide*>(GetMoveSlot())->GetSpeedIncrease() * (float)facing, m_vtVelocity.y };
		SetCurrAnimation("playersliding");
		AnimationSystem::GetInstance()->StartPlaying(animInfo);
		AnimationSystem::GetInstance()->StartLooping(animInfo);
	}
}

void Player::UpdateTimers(float elapsedTime)
{
	if (m_fComboTimer > 0)
	{
		m_fComboTimer -= elapsedTime;
		if (m_fComboTimer < 0)
		{
			if (m_iMaxComboGained < m_iComboMultipiler)
				m_iMaxComboGained = m_iComboMultipiler;

			m_fComboTimer = 0;
			m_iComboMultipiler = 1;
			m_iCurrComboCount = 1;
		}
	}

	//all the dash timer information
	if (dashTimer <= 0.0f && usingAbility && dashing)
	{
		dashing = false;
		usingAbility = false;
		dashTimer = 0.0f;

		m_vtVelocity = { 0.0f, m_vtVelocity.y };

		EnterWalking();
	}
	else if (dashTimer > 0.0f)
	{
		dashTimer -= elapsedTime;
		Dash();
	}

	else if (dashCooldown > 0.0f)
		dashCooldown -= elapsedTime;

	//all the back dash timer information
	if (backDashTimer <= 0.0f && usingAbility && backDashing)
	{
		backDashing = false;
		usingAbility = false;
		backDashTimer = 0.0f;

		m_vtVelocity = { 0.0f, m_vtVelocity.y };

		EnterWalking();
	}
	else if (backDashTimer > 0.0f)
		backDashTimer -= elapsedTime;
	else if (backDashCoolDown > 0.0f)
		backDashCoolDown -= elapsedTime;

	//all the slide timer information
	if (slideTimer <= 0.0f && usingAbility && sliding)
	{
		sliding = false;
		usingAbility = false;
		slideTimer = 0.0f;

		m_vtVelocity = { 0.0f, m_vtVelocity.y };

		EnterWalking();
	}
	else if (slideTimer > 0.0f)
		slideTimer -= elapsedTime;
	else if (slideCoolDown > 0.0f)
		slideCoolDown -= elapsedTime;

	//all the shield timer information
	if (Shieldtimer >= 0)
	{
		Shieldtimer -= elapsedTime;
		if (Shieldtimer <= 0)
			Shieldtimer = 0;
	}
}

void Player::Shoot()
{
	if (state == State::CLIMBING) return;

	if (m_aStyleSlot != nullptr && (m_aStyleSlot->GetAugName() == "Shockwave" || m_aStyleSlot->GetAugName() == "Fire Blast"))
	{
		CreateBulletMessage * Msg = new CreateBulletMessage{ this, 0.0f };
		Msg->QueueMessage();
		Msg = nullptr;
		CreateBulletMessage * Msg2 = new CreateBulletMessage{ this, 45 };
		Msg2->QueueMessage();
		Msg2 = nullptr;
		CreateBulletMessage * Msg3 = new CreateBulletMessage{ this, -45 };
		Msg3->QueueMessage();
		Msg3 = nullptr;
	}
	else if (m_aBulletSlot != nullptr && m_aBulletSlot->GetAugName() == "Double Shot" || (m_aStyleSlot != nullptr && m_aStyleSlot->GetAugName() == "Double Shot"))
	{
		CreateBulletMessage * Msg = new CreateBulletMessage{ this, 0.0f };
		Msg->QueueMessage();
		Msg = nullptr;
		CreateBulletMessage * Msg2 = new CreateBulletMessage{ this, -180.0f };
		Msg2->QueueMessage();
		Msg2 = nullptr;
	}
	else
	{
		CreateBulletMessage * Msg = new CreateBulletMessage{ this, 0 };
		Msg->QueueMessage();
		Msg = nullptr;
	}




}

void Player::TakeAugment(GameObject* pOther, int slot)
{
	Augment * temp = (Augment*)pOther;
	temp->SetpickedUp(true);
	temp->SetPosition({ -1, -1 });
	//if the augment is a movement augment
	if ((pOther->GetType() >= 60 && pOther->GetType() < 65) && slot == 0)
	{
		if (m_aMoveSlot == nullptr)
			m_aMoveSlot = (Augment*)pOther;
		else if (HotSwap[0] == nullptr)
			HotSwap[0] = (Augment*)pOther;
		else if (HotSwap[1] == nullptr)
			HotSwap[1] = (Augment*)pOther;
		else if (HotSwap[2] == nullptr)
			HotSwap[2] = (Augment*)pOther;
		else if (HotSwap[3] == nullptr)
			HotSwap[3] = (Augment*)pOther;
		else
		{
			AugmentMoveTable.push_back(m_aMoveSlot);
			m_aMoveSlot = (Augment*)pOther;
		}
	}
	//if the augment is a weapon augment
	else if (slot == 0 && pOther->GetType() > 66)
	{
		temp->SetAugType(1);

		if (m_aStyleSlot == nullptr)
			m_aStyleSlot = (Augment*)pOther;
		else if (HotSwap[0] == nullptr)
			HotSwap[0] = (Augment*)pOther;
		else if (HotSwap[1] == nullptr)
			HotSwap[1] = (Augment*)pOther;
		else if (HotSwap[2] == nullptr)
			HotSwap[2] = (Augment*)pOther;
		else if (HotSwap[3] == nullptr)
			HotSwap[3] = (Augment*)pOther;
		else
		{
			AugmentWeaponTable.push_back(m_aStyleSlot);
			m_aStyleSlot = (Augment*)pOther;
		}

	}
	else if (slot == 1 && pOther->GetType() > 66)
	{
		temp->SetAugType(0);

		if (m_aBulletSlot == nullptr)
			m_aBulletSlot = (Augment*)pOther;
		else if (HotSwap[0] == nullptr)
			HotSwap[0] = (Augment*)pOther;
		else if (HotSwap[1] == nullptr)
			HotSwap[1] = (Augment*)pOther;
		else if (HotSwap[2] == nullptr)
			HotSwap[2] = (Augment*)pOther;
		else if (HotSwap[3] == nullptr)
			HotSwap[3] = (Augment*)pOther;
		else
		{
			AugmentWeaponTable.push_back(m_aBulletSlot);
			m_aBulletSlot = (Augment*)pOther;
		}
	}
	else
	{
		//Send to base directly
		if (pOther->GetType() >= 60 && pOther->GetType() < 65)
		{
			AugmentMoveTable.push_back((Augment*)pOther);
		}
		else
		{
			AugmentWeaponTable.push_back((Augment*)pOther);
		}
	}

}

void Player::HotSwapFunctionality()
{
	if (theGame->HotSwapUpInput()) //Dpad up
	{
		if (HotSwap[0] != nullptr && HotSwap[0]->GetType() >= 60 && HotSwap[0]->GetType() < 65)//Swap moveslot with Hotswap[0] if its move. Up on Dpad
		{
			if (m_aMoveSlot != nullptr)
			{
				Augment * temp = m_aMoveSlot;
				m_aMoveSlot = HotSwap[0];
				HotSwap[0] = temp;
			}
			else
			{
				m_aMoveSlot = HotSwap[0];
				HotSwap[0] = nullptr;
			}	
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);
		}

		if (HotSwap[0] != nullptr && HotSwap[0]->GetType() >= 70 && HotSwap[0]->GetType() < 82 && HotSwap[0]->GetAugType() == 0) // Swap Bulletslot with HotSwap[0] Up on Dpad
		{
			if (m_aBulletSlot != nullptr)
			{
				Augment * temp = m_aBulletSlot;
				m_aBulletSlot = HotSwap[0];
				HotSwap[0] = temp;
			}
			else
			{
				m_aBulletSlot = HotSwap[0];
				HotSwap[0] = nullptr;
			}
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}
		if (HotSwap[0] != nullptr && HotSwap[0]->GetType() >= 70 && HotSwap[0]->GetType() < 82 && HotSwap[0]->GetAugType() == 1 && m_aStyleSlot != nullptr) // Swap Styleslot with HotSwap[0] Up on Dpad
		{
			Augment * temp = m_aStyleSlot;
			m_aStyleSlot = HotSwap[0];
			HotSwap[0] = temp;
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}
	}
	if (theGame->HotSwapDownInput()) //hotswap down
	{
		if (HotSwap[2] != nullptr && HotSwap[2]->GetType() >= 60 && HotSwap[2]->GetType() < 65)//Swap moveslot with Hotswap[2] if its move. Down on Dpad
		{
			if (m_aMoveSlot != nullptr)
			{
				Augment * temp = m_aMoveSlot;
				m_aMoveSlot = HotSwap[2];
				HotSwap[2] = temp;
			}
			else
			{
				m_aMoveSlot = HotSwap[2];
				HotSwap[2] = nullptr;
			}
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}

		if (HotSwap[2] != nullptr && HotSwap[2]->GetType() >= 70 && HotSwap[2]->GetType() < 82 && HotSwap[2]->GetAugType() == 0) // Swap Bulletslot with HotSwap[2] Down on Dpad
		{
			if (m_aBulletSlot != nullptr)
			{
				Augment * temp = m_aBulletSlot;
				m_aBulletSlot = HotSwap[2];
				HotSwap[2] = temp;
			}
			else
			{
				m_aBulletSlot = HotSwap[2];
				HotSwap[2] = nullptr;
			}
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}
		if (HotSwap[2] != nullptr && HotSwap[2]->GetType() >= 70 && HotSwap[2]->GetType() < 82 && HotSwap[2]->GetAugType() == 1 && m_aStyleSlot != nullptr) // Swap Styleslot with HotSwap[2] Down on Dpad
		{
			Augment * temp = m_aStyleSlot;
			m_aStyleSlot = HotSwap[2];
			HotSwap[2] = temp;
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}
	}
	if (theGame->HotSwapRightInput()) //Dpad DOwn
	{
		if (HotSwap[1] != nullptr && HotSwap[1]->GetType() >= 60 && HotSwap[1]->GetType() < 65)//Swap moveslot with Hotswap[1] if its move. Right on Dpad
		{
			if (m_aMoveSlot != nullptr)
			{
				Augment * temp = m_aMoveSlot;
				m_aMoveSlot = HotSwap[1];
				HotSwap[1] = temp;
			}
			else
			{
				m_aMoveSlot = HotSwap[1];
				HotSwap[1] = nullptr;
			}
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}

		if (HotSwap[1] != nullptr && HotSwap[1]->GetType() >= 70 && HotSwap[1]->GetType() < 82 && HotSwap[1]->GetAugType() == 0) // Swap Bulletslot with HotSwap[1] Right on Dpad
		{
			if (m_aBulletSlot != nullptr)
			{
				Augment * temp = m_aBulletSlot;
				m_aBulletSlot = HotSwap[1];
				HotSwap[1] = temp;
			}
			else
			{
				m_aBulletSlot = HotSwap[1];
				HotSwap[1] = nullptr;
			}
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}
		if (HotSwap[1] != nullptr && HotSwap[1]->GetType() >= 70 && HotSwap[1]->GetType() < 82 && HotSwap[1]->GetAugType() == 1 && m_aStyleSlot != nullptr) // Swap Styleslot with HotSwap[1] Right on Dpad
		{
			Augment * temp = m_aStyleSlot;
			m_aStyleSlot = HotSwap[1];
			HotSwap[1] = temp;
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}
	}
	if (theGame->HotSwapLeftInput()) //Dpad Left
	{
		if (HotSwap[3] != nullptr && HotSwap[3]->GetType() >= 60 && HotSwap[3]->GetType() < 65)//Swap moveslot with Hotswap[3] if its move. Left on Dpad
		{
			if (m_aMoveSlot != nullptr)
			{
				Augment * temp = m_aMoveSlot;
				m_aMoveSlot = HotSwap[3];
				HotSwap[3] = temp;
			}
			else
			{
				m_aMoveSlot = HotSwap[3];
				HotSwap[3] = nullptr;
			}
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}

		if (HotSwap[3] != nullptr && HotSwap[3]->GetType() >= 70 && HotSwap[3]->GetType() < 82 && HotSwap[3]->GetAugType() == 0) // Swap Bulletslot with HotSwap[3] Left on Dpad
		{
			if (m_aBulletSlot != nullptr)
			{
				Augment * temp = m_aBulletSlot;
				m_aBulletSlot = HotSwap[3];
				HotSwap[3] = temp;
			}
			else
			{
				m_aBulletSlot = HotSwap[3];
				HotSwap[3] = nullptr;
			}
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}
		if (HotSwap[3] != nullptr && HotSwap[3]->GetType() >= 70 && HotSwap[3]->GetType() < 82 && HotSwap[3]->GetAugType() == 1 && m_aStyleSlot != nullptr) // Swap Styleslot with HotSwap[3] Left on Dpad
		{
			Augment * temp = m_aStyleSlot;
			m_aStyleSlot = HotSwap[3];
			HotSwap[3] = temp;
			SGD::AudioManager::GetInstance()->PlayAudio(m_AAugSwap);

		}
	}
}

void Player::AugmentTableFunctionality()
{
	if (m_bTouchingWepTable || m_bTouchingMoveTable)
	{
		if (m_bUsingBulletTable)
		{
			if (AugmentWeaponTable.size() > 0)
			{
				if (theGame->TableCycleLeftInput())
					m_nCursor++;

				if (theGame->TableCycleRightInput())
					m_nCursor -= 1;


				if (theGame->MovementAbilityInput()) //Take Gem into Bullet Slot
				{
					if (m_aBulletSlot != nullptr) // bullet slot is being used
					{
						Augment * tempswap = m_aBulletSlot; // save current bullet slot 
						m_aBulletSlot = AugmentWeaponTable[m_nCursor]; // Add augment to bullet slot
						AugmentWeaponTable[m_nCursor] = tempswap; // add old bullet slot to table Dont decrease cursor
					}
					else // Bullet slot is empty
					{
						m_aBulletSlot = AugmentWeaponTable[m_nCursor]; // Add augment to bullet slot
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
						m_nCursor -= 1; //decrease cursor
					}
					m_aBulletSlot->SetAugType(0); // Set aug type to bullet style
				}

				if (theGame->HotSwapUpInput()) //Or Dpad Up
				{
					if (HotSwap[0] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[0];
						if (HotSwap[0]->GetType() > 60 && HotSwap[0]->GetType() < 65) //Hotswap is a movetype
						{
							AugmentMoveTable.push_back(HotSwap[0]); //Push back current hotswap to movetable
							HotSwap[0] = AugmentWeaponTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of weapon type
						{
							HotSwap[0] = AugmentWeaponTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentWeaponTable[m_nCursor] = tempswap;
						}
					}
					else //HotSwap is null
					{
						HotSwap[0] = AugmentWeaponTable[m_nCursor];
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
					HotSwap[0]->SetAugType(0); //Set AugType to BulletType
				}
				if (theGame->HotSwapDownInput())
				{
					if (HotSwap[2] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[2];
						if (HotSwap[2]->GetType() > 60 && HotSwap[2]->GetType() < 65) //Hotswap is a movetype
						{
							AugmentMoveTable.push_back(HotSwap[2]); //Push back current hotswap to movetable
							HotSwap[2] = AugmentWeaponTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of weapon type
						{
							HotSwap[2] = AugmentWeaponTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentWeaponTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[2] = AugmentWeaponTable[m_nCursor];
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
					HotSwap[2]->SetAugType(0); //Set AugType to BulletType
				}
				if (theGame->HotSwapLeftInput())
				{
					if (HotSwap[3] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[3];
						if (HotSwap[3]->GetType() > 60 && HotSwap[3]->GetType() < 65) //Hotswap is currently being used, swap out with choice and replace.
						{

							AugmentMoveTable.push_back(HotSwap[3]); //Push back current hotswap to movetable
							HotSwap[3] = AugmentWeaponTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of weapon type
						{
							HotSwap[3] = AugmentWeaponTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentWeaponTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[3] = AugmentWeaponTable[m_nCursor];
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
					HotSwap[3]->SetAugType(0); //Set AugType to BulletType
				}
				if (theGame->HotSwapRightInput())
				{
					if (HotSwap[1] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{

						Augment * tempswap = HotSwap[1];
						if (HotSwap[1]->GetType() > 60 && HotSwap[1]->GetType() < 65) //Hotswap is currently being used, swap out with choice and replace.
						{

							AugmentMoveTable.push_back(HotSwap[1]); //Push back current hotswap to movetable
							HotSwap[1] = AugmentWeaponTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of weapon type
						{
							HotSwap[1] = AugmentWeaponTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentWeaponTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[1] = AugmentWeaponTable[m_nCursor];
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
					HotSwap[1]->SetAugType(0); //Set AugType to BulletType
				}
			}
		}
		if (m_bUsingShotTable)
		{
			if (AugmentWeaponTable.size() > 0)
			{
				if (theGame->TableCycleRightInput())
					m_nCursor++;

				if (theGame->TableCycleLeftInput())
					m_nCursor -= 1;

				if (theGame->MovementAbilityInput()) //Take Gem into Style Slot
				{
					if (m_aStyleSlot != nullptr) // Style slot is being used
					{
						Augment * tempswap = m_aStyleSlot; // save current Style slot 
						m_aStyleSlot = AugmentWeaponTable[m_nCursor]; // Add augment to Style slot
						AugmentWeaponTable[m_nCursor] = tempswap; // add old Style slot to table Dont decrease cursor
					}
					else // Style slot is empty
					{
						m_aStyleSlot = AugmentWeaponTable[m_nCursor]; // Add augment to Style slot
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
						m_nCursor -= 1; //decrease cursor
					}
					m_aStyleSlot->SetAugType(1); // Set Aug Type to Styleslot
				}

				if (theGame->HotSwapUpInput()) //Or Dpad Up
				{
					if (HotSwap[0] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[0];
						if (HotSwap[0]->GetType() >= 60 && HotSwap[0]->GetType() < 65) //Hotswap is a movetype
						{
							AugmentMoveTable.push_back(HotSwap[0]); //Push back current hotswap to movetable
							HotSwap[0] = AugmentWeaponTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of weapon type
						{
							HotSwap[0] = AugmentWeaponTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentWeaponTable[m_nCursor] = tempswap;
						}
					}
					else //HotSwap is null
					{
						HotSwap[0] = AugmentWeaponTable[m_nCursor];
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
					HotSwap[0]->SetAugType(1); //Set AugType to ShotStyleType
				}
				if (theGame->HotSwapDownInput())
				{
					if (HotSwap[2] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[2];
						if (HotSwap[2]->GetType() >= 60 && HotSwap[2]->GetType() < 65) //Hotswap is a movetype
						{
							AugmentMoveTable.push_back(HotSwap[2]); //Push back current hotswap to movetable
							HotSwap[2] = AugmentWeaponTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of weapon type
						{
							HotSwap[2] = AugmentWeaponTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentWeaponTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[2] = AugmentWeaponTable[m_nCursor];
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
					HotSwap[2]->SetAugType(1); //Set AugType to ShotStyleType
				}
				if (theGame->HotSwapLeftInput())
				{
					if (HotSwap[3] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[3];
						if (HotSwap[3]->GetType() >= 60 && HotSwap[3]->GetType() < 65) //Hotswap is currently being used, swap out with choice and replace.
						{

							AugmentMoveTable.push_back(HotSwap[3]); //Push back current hotswap to movetable
							HotSwap[3] = AugmentWeaponTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of weapon type
						{
							HotSwap[3] = AugmentWeaponTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentWeaponTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[3] = AugmentWeaponTable[m_nCursor];
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
					HotSwap[3]->SetAugType(1); //Set AugType to ShotStyleType
				}
				if (theGame->HotSwapRightInput())
				{
					if (HotSwap[1] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{

						Augment * tempswap = HotSwap[1];
						if (HotSwap[1]->GetType() >= 60 && HotSwap[1]->GetType() < 65) //Hotswap is currently being used, swap out with choice and replace.
						{

							AugmentMoveTable.push_back(HotSwap[1]); //Push back current hotswap to movetable
							HotSwap[1] = AugmentWeaponTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of weapon type
						{
							HotSwap[1] = AugmentWeaponTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentWeaponTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[1] = AugmentWeaponTable[m_nCursor];
						AugmentWeaponTable.erase(AugmentWeaponTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
					HotSwap[1]->SetAugType(1); //Set AugType to ShotStyleType
				}
			}
		}
		if (m_bUsingMoveTable)
		{


			if (AugmentMoveTable.size() > 0)
			{
				if (theGame->TableCycleRightInput())
					m_nCursor++;

				if (theGame->TableCycleLeftInput())
					m_nCursor -= 1;

				if (theGame->MovementAbilityInput()) //Take Gem into Move Slot
				{
					if (m_aMoveSlot != nullptr) // Move slot is being used
					{
						Augment * tempswap = m_aMoveSlot; // save current Move slot 
						m_aMoveSlot = AugmentMoveTable[m_nCursor]; // Add augment to Move slot
						AugmentMoveTable[m_nCursor] = tempswap; // add old Move slot to table Dont decrease cursor
					}
					else // Move slot is empty
					{
						m_aMoveSlot = AugmentMoveTable[m_nCursor]; // Add augment to Move slot
						AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor); //Remove augment from table
						m_nCursor -= 1; //decrease cursor
					}

				}


				if (theGame->HotSwapUpInput()) //Or Dpad Up
				{
					if (HotSwap[0] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[0];
						if (HotSwap[0]->GetType() > 69 && HotSwap[0]->GetType() < 82) //Hotswap is a weptype
						{
							AugmentWeaponTable.push_back(HotSwap[0]); //Push back current hotswap to movetable
							HotSwap[0] = AugmentMoveTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of move type
						{
							HotSwap[0] = AugmentMoveTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentMoveTable[m_nCursor] = tempswap;
						}
					}
					else //HotSwap is null
					{
						HotSwap[0] = AugmentMoveTable[m_nCursor];
						AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
				}
				if (theGame->HotSwapDownInput())
				{
					if (HotSwap[2] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[2];
						if (HotSwap[2]->GetType() > 69 && HotSwap[2]->GetType() < 82) //Hotswap is a weptype
						{
							AugmentWeaponTable.push_back(HotSwap[2]); //Push back current hotswap to table
							HotSwap[2] = AugmentMoveTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of move type
						{
							HotSwap[2] = AugmentMoveTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentMoveTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[2] = AugmentMoveTable[m_nCursor];
						AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
				}
				if (theGame->HotSwapLeftInput())
				{
					if (HotSwap[3] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{
						Augment * tempswap = HotSwap[3];
						if (HotSwap[3]->GetType() > 69 && HotSwap[3]->GetType() < 82) //Hotswap is currently being used, swap out with choice and replace.
						{

							AugmentWeaponTable.push_back(HotSwap[3]); //Push back current hotswap to table
							HotSwap[3] = AugmentMoveTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of Move type
						{
							HotSwap[3] = AugmentMoveTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentMoveTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[3] = AugmentMoveTable[m_nCursor];
						AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
				}
				if (theGame->HotSwapRightInput())
				{
					if (HotSwap[1] != nullptr) //Hotswap is currently being used, swap out with choice and replace.
					{

						Augment * tempswap = HotSwap[1];
						if (HotSwap[1]->GetType() > 69 && HotSwap[1]->GetType() < 82) //Hotswap is currently being used, swap out with choice and replace.
						{

							AugmentWeaponTable.push_back(HotSwap[1]); //Push back current hotswap to movetable
							HotSwap[1] = AugmentMoveTable[m_nCursor]; //Take augment from table and add to hotswap
							AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor); //Remove augment from table
							m_nCursor -= 1; //decrease cursor
						}
						else //Hotswap is of Move type
						{
							HotSwap[1] = AugmentMoveTable[m_nCursor]; //Swap out augment and hotswap.
							AugmentMoveTable[m_nCursor] = tempswap;
						}
					}
					else
					{
						HotSwap[1] = AugmentMoveTable[m_nCursor];
						AugmentMoveTable.erase(AugmentMoveTable.begin() + m_nCursor);
						m_nCursor -= 1;
					}
				}
			}
		}
	}
}void Player::SetAppropiateFireRate()
{
	if (m_aBulletSlot == nullptr && m_aStyleSlot == nullptr)
	{
		m_fAttackRate = 0.4f;
		return;
	}
	if (m_aBulletSlot == nullptr)
	{
		if (m_aStyleSlot->GetAugName() == "Arcane Shot")
		{
			ArcaneShot* temp = (ArcaneShot*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Arcane Beam")
		{
			ArcaneBeam* temp = (ArcaneBeam*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Double Shot")
		{
			DoubleShot* temp = (DoubleShot*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Electron Shot")
		{
			ElectronShot* temp = (ElectronShot*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Explosive")
		{
			Explosive* temp = (Explosive*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Fire Blast")
		{
			FireBlast* temp = (FireBlast*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Magic Missile")
		{
			MagicMissile* temp = (MagicMissile*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Photon Shot")
		{
			PhotonShot* temp = (PhotonShot*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Seeker Sludge")
		{
			SeekerSludge* temp = (SeekerSludge*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Shockwave")
		{
			ShockWave* temp = (ShockWave*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Solar Flare")
		{
			SolarFlare* temp = (SolarFlare*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aStyleSlot->GetAugName() == "Vampiric Magnet")
		{
			VampiricMagnet* temp = (VampiricMagnet*)m_aStyleSlot;
			m_fAttackRate = temp->GetFireRate();
		}
	}
	else
	{
		if (m_aBulletSlot->GetAugName() == "Arcane Shot")
		{
			ArcaneShot* temp = (ArcaneShot*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Arcane Beam")
		{
			ArcaneBeam* temp = (ArcaneBeam*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Double Shot")
		{
			DoubleShot* temp = (DoubleShot*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Electron Shot")
		{
			ElectronShot* temp = (ElectronShot*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Explosive")
		{
			Explosive* temp = (Explosive*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Fire Blast")
		{
			FireBlast* temp = (FireBlast*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Magic Missile")
		{
			MagicMissile* temp = (MagicMissile*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Photon Shot")
		{
			PhotonShot* temp = (PhotonShot*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Seeker Sludge")
		{
			SeekerSludge* temp = (SeekerSludge*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Shockwave")
		{
			ShockWave* temp = (ShockWave*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Solar Flare")
		{
			SolarFlare* temp = (SolarFlare*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
		if (m_aBulletSlot->GetAugName() == "Vampiric Magnet")
		{
			VampiricMagnet* temp = (VampiricMagnet*)m_aBulletSlot;
			m_fAttackRate = temp->GetFireRate();
		}
	}
}

void Player::ModifyScore(int amount)
{
	if (m_fComboTimer <= 0)
		m_fComboTimer = 5.0f;
	else
		m_fComboTimer += 1.0f;


	if (m_fComboTimer > 0)
	{

		++m_iCurrComboCount;
		if (m_iCurrComboCount > m_iComboMultipiler)
		{
			m_iComboMultipiler = m_iCurrComboCount;
			m_iCurrComboCount = 1;
			if (m_iComboMultipiler == 3)
				Game::GetInstance()->PlaySFX(Game::GetInstance()->SMALLCOMBOBREAK);
			if (m_iComboMultipiler == 6)
				Game::GetInstance()->PlaySFX(Game::GetInstance()->COMBOBREAKER);
		}
		score += amount*m_iComboMultipiler;
	}
	else
		score += amount;
}

void Player::AugmentTableInterface()
{
	SGD::GraphicsManager * pGraphics = SGD::GraphicsManager::GetInstance();
	BitmapFont* pFont = Game::GetInstance()->GetFont();
	SGD::Point position;
	SGD::Rectangle renderrect;
	std::ostringstream ossaug;
	renderrect.left = 325;
	renderrect.top = 75;
	renderrect.right = 750;
	renderrect.bottom = 320;
	position.x = this->GetPosition().x - Game::GetInstance()->GetCameraPos().x;
	position.y = this->GetPosition().y - Game::GetInstance()->GetCameraPos().y;
	if (m_bTouchingWepTable || m_bTouchingMoveTable)
	{
		if (!m_bUsingBulletTable && !m_bUsingMoveTable && !m_bUsingShotTable)
		{
			if (AugmentMoveTable.size() > 0 && m_bTouchingMoveTable)
			{
				if (SGD::InputManager::GetInstance()->IsControllerConnected(0))
					pFont->Draw("Up to Use This Table", int(position.x - 120), int(position.y - 170), 0.6f, {});
				else
				pFont->Draw("W to Use This Table", int(position.x - 120), int(position.y - 170), 0.6f, {});

			}
				if (AugmentWeaponTable.size() > 0 && m_bTouchingWepTable)
				{
					if (SGD::InputManager::GetInstance()->IsControllerConnected(0))
						pFont->Draw("Up to Use This Table", int(position.x - 120), int(position.y - 170), 0.6f, {});
					else
						pFont->Draw("W to Use This Table", int(position.x - 120), int(position.y - 170), 0.6f, {});
				}
				

		}
		else //they are using a table
		{
			pGraphics->DrawRectangle(renderrect, { 100, 100, 100, 100 }, { 0, 0, 0 }, 3);
			pGraphics->DrawString("Left Input and Right Input to Cycle\nThrough the Table\nMovementAbility to Choose\nHotSwaps to add to Selected HotSwap", { renderrect.left, renderrect.top }, { 255, 0, 0 });
		}
	}
	if (m_bUsingBulletTable)
	{
		ossaug.fill('0');
		int augtablesize = AugmentWeaponTable.size();
		ossaug << augtablesize;
		pGraphics->DrawString("Number of Augments on Table:", { renderrect.left, renderrect.top + 100 }, { 255, 0, 0 });
		pGraphics->DrawString(ossaug.str().c_str(), { renderrect.right - 30, renderrect.top + 100 }, { 255, 0, 0 });

		if (AugmentWeaponTable.size() > 0)
		{
			string augtempname = AugmentWeaponTable[m_nCursor]->GetAugName();
			pGraphics->DrawString("BulletType:", { renderrect.left, renderrect.top + 160 }, { 255, 0, 0 });
			pGraphics->DrawString("Augment:", { renderrect.left, renderrect.top + 130 }, { 255, 0, 0 });
			pGraphics->DrawString(augtempname.c_str(), { renderrect.right - 175, renderrect.top + 130 }, { 255, 0, 0 });
			if (augtempname == "Arcane Shot")
				pGraphics->DrawString("Rapid Fire", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Arcane Beam")
				pGraphics->DrawString("Beam", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Double Shot")
				pGraphics->DrawString("Mirror", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Electron Shot")
				pGraphics->DrawString("Piercing", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Explosive")
				pGraphics->DrawString("Area of Effect", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Fire Blast")
				pGraphics->DrawString("Damage over time", { renderrect.left + 245, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Magic Missile")
				pGraphics->DrawString("Double Damage", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Seeker Sludge")
				pGraphics->DrawString("Slow", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Shockwave")
				pGraphics->DrawString("Knockback", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Solar Flare")
				pGraphics->DrawString("Stun", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Vampiric Magnet")
				pGraphics->DrawString("Life Steal", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Photon Shot")
				pGraphics->DrawString("Ricochet", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			SGD::HTexture augtempimg = AugmentWeaponTable[m_nCursor]->GetImage();
			pGraphics->DrawTexture(augtempimg, { renderrect.left + 170, renderrect.top + 130 });
			if (augtablesize > 1)
			{
				pGraphics->DrawString(">>>", { renderrect.left + 200, renderrect.top + 130 }, { 0, 255, 0 });
				pGraphics->DrawString("<<<", { renderrect.left + 120, renderrect.top + 130 }, { 0, 255, 0 });
			}
		}
	}
	if (m_bUsingMoveTable)
	{
		ossaug.fill('0');
		int augtablesize = AugmentMoveTable.size();
		ossaug << augtablesize;
		pGraphics->DrawString("Number of Augments on Table:", { renderrect.left, renderrect.top + 100 }, { 255, 0, 0 });
		pGraphics->DrawString(ossaug.str().c_str(), { renderrect.right - 30, renderrect.top + 100 }, { 255, 0, 0 });
		if (AugmentMoveTable.size() > 0)
		{
			string augtempname = AugmentMoveTable[m_nCursor]->GetAugName();
			pGraphics->DrawString("Augment:", { renderrect.left, renderrect.top + 130 }, { 255, 0, 0 });
			pGraphics->DrawString(augtempname.c_str(), { renderrect.right - 150, renderrect.top + 130 }, { 255, 0, 0 });


		//	pFont->Draw(augtempname.c_str(), int(position.x - 120), int(position.y - 170), 0.6f, {});
			SGD::HTexture augtempimg = AugmentMoveTable[m_nCursor]->GetImage();
			pGraphics->DrawTexture(augtempimg, { renderrect.left + 170, renderrect.top + 130 });
			if (augtablesize > 1)
			{
				pGraphics->DrawString(">>>", { renderrect.left + 200, renderrect.top + 130 }, { 0, 255, 0 });
				pGraphics->DrawString("<<<", { renderrect.left + 120, renderrect.top + 130 }, { 0, 255, 0 });
			}

		}
	}
	if (m_bUsingShotTable)
	{
		ossaug.fill('0');
		int augtablesize = AugmentWeaponTable.size();
		ossaug << augtablesize;
		pGraphics->DrawString("Number of Augments on Table:", { renderrect.left, renderrect.top + 100 }, { 255, 0, 0 });
		pGraphics->DrawString(ossaug.str().c_str(), { renderrect.right - 30, renderrect.top + 100 }, { 255, 0, 0 });
		if (AugmentWeaponTable.size() > 0)
		{
			string augtempname = AugmentWeaponTable[m_nCursor]->GetAugName();
			pGraphics->DrawString("ShotStyle:", { renderrect.left, renderrect.top + 160 }, { 255, 0, 0 });
			pGraphics->DrawString("Augment:", { renderrect.left, renderrect.top + 130 }, { 255, 0, 0 });
			pGraphics->DrawString(augtempname.c_str(), { renderrect.right - 175, renderrect.top + 130 }, { 255, 0, 0 });
			if (augtempname == "Arcane Shot")
				pGraphics->DrawString("Straight Line", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Arcane Beam")
				pGraphics->DrawString("Straight Line", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Double Shot")
				pGraphics->DrawString("Boomerang", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Electron Shot")
				pGraphics->DrawString("Wave", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Explosive")
				pGraphics->DrawString("Arc", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Fire Blast")
				pGraphics->DrawString("Spread", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Magic Missile")
				pGraphics->DrawString("Homing", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Seeker Sludge")
				pGraphics->DrawString("Homing", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Shockwave")
				pGraphics->DrawString("Spread", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Solar Flare")
				pGraphics->DrawString("Arc", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Vampiric Magnet")
				pGraphics->DrawString("Boomerang", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			if (augtempname == "Photon Shot")
				pGraphics->DrawString("Wave", { renderrect.left + 250, renderrect.top + 160 }, { 255, 0, 0 });
			SGD::HTexture augtempimg = AugmentWeaponTable[m_nCursor]->GetImage();
			pGraphics->DrawTexture(augtempimg, { renderrect.left + 170, renderrect.top + 130 });
			if (augtablesize > 1)
			{
				pGraphics->DrawString(">>>", { renderrect.left + 200, renderrect.top + 130 }, { 0, 255, 0 });
				pGraphics->DrawString("<<<", { renderrect.left + 120, renderrect.top + 130 }, { 0, 255, 0 });
			}

		}
	}
}
